<?php
/**
 * Created by PhpStorm.
 * User: R.Ice
 * Date: 2018/8/23
 * Time: 15:08
 * name:新增机构ERP-企业组织架构配置
 * url:/erpEnterpriseStructure/add_enterprise_structure_config
 */

$oesc_oesid                   = $route->bodyParams['oesc_oesid'];              //关联组织结构节点ID
$oesc_contract_remind         = $route->bodyParams['oesc_contract_remind'];   //合同结束前几天提醒（单位：天）0-不提醒
$esc_class_hour_remind        = $route->bodyParams['esc_class_hour_remind'];  //剩余课时少于多少课时提醒（单位：课时）0-不提醒
$esc_full_attendance_reward   = $route->bodyParams['esc_full_attendance_reward'];  //全勤奖励
$esc_leave_deducation         = $route->bodyParams['esc_leave_deducation'];  //请假扣款，百分比
$esc_absence_deducation       = $route->bodyParams['esc_absence_deducation'];  //旷工扣款，百分比
$esc_work_time                = $route->bodyParams['esc_work_time'];  //上班时段，|隔开，例如：08:00-18:00|12:00-1400
$esc_desc                     = $route->bodyParams['esc_desc'];  //
$esc_work_date                = $route->bodyParams['esc_work_date'];  //上班时间，|隔开，例如：1,2,3,4,5,6,7
$oesc_part_time_job_work_date = $route->bodyParams['oesc_part_time_job_work_date'];  //上班时间，|隔开，例如：1,2,3,4,5,6,7
$esc_class_time               = $route->bodyParams['esc_class_time'];  //上班时间，|隔开，例如：1,2,3,4,5,6,7
$esc_number_of_courses        = $route->bodyParams['esc_number_of_courses'];  //上班时间，|隔开，例如：1,2,3,4,5,6,7
$esc_class_time_area        = $route->bodyParams['esc_class_time_area'];  //上课时段类型 上午-0，下午-1，晚上-2

//写入数组
$insertArr = [
    'oesc_oesid'                   =>$oesc_oesid,
    'oesc_contract_remind'         =>$oesc_contract_remind,
    'esc_class_hour_remind'        =>$esc_class_hour_remind,
    'esc_full_attendance_reward'   =>$esc_full_attendance_reward,
    'esc_leave_deducation'         =>$esc_leave_deducation,
    'esc_absence_deducation'       =>$esc_absence_deducation,
    'esc_work_time'                =>"09:00-20:00|09:00-20:00|09:00-20:00|09:00-21:00|09:00-21:00|09:00-21:00|09:00-21:00",
    'esc_desc'                     =>$esc_desc,
    'esc_work_date'                =>"1,2,3,4,5,6,7",
    'oesc_part_time_job_work_date' =>$oesc_part_time_job_work_date,
    'esc_class_time'               =>"10:00-10:50|11:00-11:50|14:00-14:50|15:00-15:50|17:00-17:50|18:00-18:50",
    'esc_number_of_courses'        =>"第1节|第2节|第3节|第4节|第5节|第6节",
    'esc_class_time_area'          =>"0|0|1|1|2|2",
];
//执行写入语句
$rsData = $db->mysqlDB->insert("oa_enterprise_structure_config",$insertArr);

//返回成功结果
$response->responseData( true, $rsData );
